<script setup>
import { ref, onMounted } from 'vue'
import { useRouter } from 'vue-router'
const route = useRouter()
const path = ref('/ranking')
const banners = ref([
    '/img/banner1.jpg', '/img/banner2.jpg', '/img/banner3.jpg', '/img/banner4.jpg', '/img/banner5.jpg'
])

function selTab(item){
    path.value = item.path;
    route.push({ path: item.path })
}

onMounted(() => {
    setInterval(function () {
        path.value = "/"
    }, 1000)
})
</script>
<template>
    <div class="rank-index">
        <div class="dm-carousel banner-inner" style="height:255px">
            <div class="slick-slider slick-initialized" style="height: 255px;">
                <el-carousel height="255px">
                    <el-carousel-item v-for="(item, index) in banners" :key="index">
                        <el-image :src="item" fit="fill" style="height: 100%;"></el-image>
                    </el-carousel-item>
                </el-carousel>
            </div>
        </div>
        <!-- <router-view></router-view> -->
    </div>
</template>

<style scoped lang="scss">
.rank-index {
    width: 1200px;
    margin: 20px;
}

.banner-inner {
    background-color: #fff;
    border-radius: 5px;
    margin: 12px auto 0;
    overflow: hidden;
}

.dm-carousel {
    position: relative;
}

.dm-carousel .slick-slider {
    width: 100%;
    height: 100%;
}

.dm-carousel .slick-slider {
    position: relative;
    display: block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -ms-touch-action: pan-y;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

.dm-carousel .slick-slider .slick-list,
.dm-carousel .slick-slider .slick-track {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.dm-carousel .slick-list {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.rank-index .rank-index-navbar {
    height: 48px;
    margin: 12px auto;
    border-radius: 6px;
    -webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.home-navbar {
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.home-navbar .home-navbar-item:not(:last-child) {
    padding-right: 48px;
}

.home-navbar .home-navbar-item {
    display: block;
    font-size: 16px;
    cursor: pointer;
    -webkit-transition: color .12s linear;
    transition: color .12s linear;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: #366cd9;
}

.home-navbar .home-navbar-item:hover {
    color: #fa4b8b;
}

.home-navbar .home-navbar-item.active {
    font-weight: 700;
    color: #fa4b8b;
}

.home-navbar .home-navbar-item:hover {
    cursor: pointer;
}
</style>